<template>
    <div class="info-tool">
        <div class="little-helper" v-drag v-show="showLittleHelper">
            <div class="head can-drag">
                <img src="@/assets/image/kwt.png" class="can-drag" draggable="false"/>
                <p class="can-drag">首页智能质控小助手(<span class="can-drag">{{infoData.nationScore}}分</span>)</p>
                <div @click="showLittleHelperPop"><i class="el-icon-arrow-down down-btn"></i></div>
            </div>
            <div class="drg-content" v-if="showDRGInfo">
                <el-collapse v-model="activeCollapse" accordion v-if="JSON.stringify(infoData.DRGsData) !== '{}' && infoData.DRGsData">
                    <el-collapse-item name="1">
                        <template slot="title">付费方式：{{infoData.YLFKFS}} {{checkCodeText('ylfkfs', infoData.YLFKFS)}}<br/>DRG分组：{{infoData.DRGsData.code}}</template>
                        <p>DRG名称：{{infoData.DRGsData.name}}
                            <span v-if="!isEdit" class="refresh-btn" @click="refreshDRG()"><svg-icon icon-class="refresh"/>重试</span>
                        </p>
                        <p>DRG权重：{{infoData.DRGsData.weight}}</p>
                        <p class="income">预计盈亏：
                            <span style="margin-right: 20px">{{infoData.DRGsData.drgIncome | getMoneyNum}}元</span>
                            高低倍率：<span :class="infoData.DRGsData.lowMagnification ? 'span-blue':'span-red'" v-if="infoData.DRGsData.lowMagnification || infoData.DRGsData.highMagnification">
                                {{infoData.DRGsData.lowMagnification || infoData.DRGsData.highMagnification}}
                                {{infoData.DRGsData.lowMagnification ? '低' : '高'}}
                                <i :class="infoData.DRGsData.lowMagnification ? 'el-icon-bottom':'el-icon-top'"/>
                            </span>
                            <span v-else>正常</span>
                        </p>
                    </el-collapse-item>
                </el-collapse>
                <el-collapse v-model="activeCollapse" accordion v-else>
                    <el-collapse-item name="1">
                        <template slot="title">DRG分组：</template>
                        <p>DRG名称：
                            <span class="refresh-btn" @click="refreshDRG()"><svg-icon icon-class="refresh"/>重试</span>
                        </p>
                        <p>DRG权重：</p>
                        <p class="income">预计盈亏：
                            <span>元</span>
                        </p>
                    </el-collapse-item>
                </el-collapse>
            </div>
            <div class="scroe">
                <div>
                    <p><span>{{infoData.nationScore || 0}}</span>分</p>
                    <p>国标得分</p>
                </div>
                <div>
                    <p><span>{{-infoData.hospitalScore || 0}}</span>分</p>
                    <p>院标扣分</p>
                </div>
                <el-button v-if="!isEdit && isLast" type="text" class="edit" icon="el-icon-edit" v-auth="{code: 100003000003}" @click="getScoreTableData"></el-button>
                <span class="icd" @click="openICDPop">ICD</span>
            </div>
            <div class="helper-content">
                <el-tabs v-model="activeHelper" stretch>
                    <el-tab-pane :label="getTabsTitle('coding')" name="coding">
                        <div class="scroll-box">
                            <el-row class="scroll-row-title">
                                <el-col :span="24"><span class="block"></span>强制缺陷(<span class="span">{{infoData.codingError.length}}</span>)
                                </el-col>
                            </el-row>
                            <el-row class="scroll-row" v-for="(item, index) in infoData.codingError" :key="'forced' + index">
                                <el-col :span="18">
                                    {{item.fieldName}}：{{item.content}}
                                </el-col>
                                <el-col :span="4" v-if="item.nationDeduction > 0">
                                    <span class="score-row">{{-item.nationDeduction}}分</span>
                                </el-col>
                                <el-col :span="24">
                                    提示：
                                    <template v-for="(it, i) in item.msg">
                                        <span class="normal" :key="'forcedTips' + i" v-if="item.msg.length > 1">
                                            {{i + 1}}.{{it}};<br/>
                                        </span>
                                        <span class="normal" :key="'forcedTips' + i" v-else>{{it}};</span>
                                    </template>
                                </el-col>
                            </el-row>
                            <el-row class="scroll-row-title">
                                <el-col :span="24"><span class="block doubt"></span>疑似缺陷(<span class="span doubt">{{infoData.codingWaring.length}}</span>)
                                </el-col>
                            </el-row>
                            <el-row class="scroll-row" v-for="(item, index) in infoData.codingWaring" :key="'suspected' + index">
                                <el-col :span="18">
                                    {{item.fieldName}}：{{item.content}}
                                </el-col>
                                <el-col :span="4" v-if="item.nationDeduction > 0">
                                    <span class="score-row">{{-item.nationDeduction}}分</span>
                                </el-col>
                                <el-col :span="24">
                                    提示：
                                    <template v-for="(it, i) in item.msg">
                                        <span class="normal" :key="'suspectedTips' + i" v-if="item.msg.length > 1">
                                            {{i + 1}}.{{it}};<br/>
                                        </span>
                                        <span class="normal" :key="'suspectedTips' + i" v-else>{{it}};</span>
                                    </template>
                                </el-col>
                                <el-col :span="2" :offset="19" v-if="!item.isIgnored">
                                    <el-button v-if="!isEdit" class="ignore" size="mini" type="primary" plain @click="ignore(item.id, 'coding')">
                                        忽略
                                    </el-button>
                                </el-col>
                                <el-col :span="10" :offset="14" v-else-if="item.isIgnored">
                                    <el-row>
                                        <el-col class="ignored" :span="10">
                                            <span>已忽略</span>
                                        </el-col>
                                        <el-col :span="12">
                                            <el-button v-if="!isEdit" size="mini" plain type="warning" @click="cancelIgnore(item.id, 'coding')">
                                                取消忽略
                                            </el-button>
                                        </el-col>
                                    </el-row>
                                </el-col>
                            </el-row>
                        </div>
                    </el-tab-pane>
                    <el-tab-pane :label="getTabsTitle('notCoding')" name="notCoding">
                        <div class="scroll-box">
                            <el-row class="scroll-row-title">
                                <el-col :span="24"><span class="block"></span>强制缺陷(<span class="span">{{infoData.noneCodingError.length}}</span>)
                                </el-col>
                            </el-row>
                            <el-row class="scroll-row" v-for="(item, index) in infoData.noneCodingError" :key="'notForced' + index">
                                <el-col :span="18">
                                    {{item.fieldName}}：{{item.content}}
                                </el-col>
                                <el-col :span="4" v-if="item.nationDeduction > 0">
                                    <span class="score-row">{{-item.nationDeduction}}分</span>
                                </el-col>
                                <el-col :span="24">
                                    提示：
                                    <template v-for="(it, i) in item.msg">
                                        <span class="normal" :key="'notForcedTips' + i" v-if="item.msg.length > 1">
                                            {{i + 1}}.{{it}};<br/>
                                        </span>
                                        <span class="normal" :key="'notForcedTips' + i" v-else>{{it}};</span>
                                    </template>
                                </el-col>
                            </el-row>
                            <el-row class="scroll-row-title">
                                <el-col :span="24"><span class="block doubt"></span>疑似缺陷(<span class="span doubt">{{infoData.noneCodingWaring.length}}</span>)
                                </el-col>
                            </el-row>
                            <el-row class="scroll-row" v-for="(item, index) in infoData.noneCodingWaring" :key="'notSuspected' + index">
                                <el-col :span="18">
                                    {{item.fieldName}}：{{item.content}}
                                </el-col>
                                <el-col :span="4" v-if="item.nationDeduction > 0">
                                    <span class="score-row">{{-item.nationDeduction}}分</span>
                                </el-col>
                                <el-col :span="24">
                                    提示：
                                    <template v-for="(it, i) in item.msg">
                                        <span class="normal" :key="'notSuspectedTips' + i" v-if="item.msg.length > 1">
                                            {{i + 1}}.{{it}};<br/>
                                        </span>
                                        <span class="normal" :key="'notSuspectedTips' + i" v-else>{{it}};</span>
                                    </template>
                                </el-col>
                                <el-col :span="2" :offset="19" v-if="!item.isIgnored">
                                    <el-button v-if="!isEdit" class="ignore" size="mini" type="primary" plain @click="ignore(item.id, 'notCoding')">
                                        忽略
                                    </el-button>
                                </el-col>
                                <el-col :span="10" :offset="14" v-else-if="item.isIgnored">
                                    <el-row>
                                        <el-col class="ignored" :span="10">
                                            <span>已忽略</span>
                                        </el-col>
                                        <el-col :span="12">
                                            <el-button v-if="!isEdit" size="mini" plain type="warning" @click="cancelIgnore(item.id, 'notCoding')">
                                                取消忽略
                                            </el-button>
                                        </el-col>
                                    </el-row>
                                </el-col>
                            </el-row>
                        </div>
                    </el-tab-pane>
                    <el-tab-pane :label="getTabsTitle('score')" name="score">
                        <div class="scroll-box">
                            <el-row class="scroll-row" v-for="(item, index) in infoData.allDeduction" :key="'score' + index">
                                <el-col :span="18">
                                    {{item.fieldName}}：{{item.content}}
                                </el-col>
                                <el-col :span="4">
                                    <span class="score-row">{{-item.nationDeduction}}分</span>
                                </el-col>
                                <el-col :span="24">
                                    提示：
                                    <template v-for="(it,i) in item.msg">
                                        <span class="normal" :key="'scoreTips' + i" v-if="item.msg.length > 1">
                                            {{i + 1}}.{{it}};<br/>
                                        </span>
                                        <span class="normal" :key="'scoreTips' + i" v-else>{{it}};</span>
                                    </template>
                                </el-col>
                            </el-row>
                        </div>
                    </el-tab-pane>
                </el-tabs>
            </div>
            <div class="feedback" :class="userType === '2' ? 'between' : ''">
                <!--<el-button type="text" icon="el-icon-edit-outline" v-auth="{code: 300009000001}" @click="showDialogFeedback">意见反馈</el-button>-->
                <el-button v-if="userType === '2'" type="primary" size="small" @click="showDialogMRFeedback">临床反馈</el-button>
            </div>
            <div class="top-line"></div>
            <div class="right-line"></div>
            <div class="bottom-line"></div>
            <div class="left-line"></div>
        </div>
        <div class="little-helper small" v-show="!showLittleHelper">
            <div class="head">
                <img src="@/assets/image/kwt.png" draggable="false"/>
                <p>首页智能质控小助手(<span>{{infoData.nationScore || 0}}分</span>)</p>
                <div @click="showLittleHelperPop"><i class="el-icon-arrow-up up-btn"></i></div>
            </div>
        </div>
        <el-dialog title="意见反馈"
                   :close-on-click-modal="false"
                   :visible.sync="isShowFeedback"
                   @close="closeDialogFeedback"
                   center
                   width="600px">
            <el-form :model="feedbackForm" :rules="rules" ref="feedbackForm" label-width="80px" class="feedback-ruleForm">
                <el-form-item label="反馈类型" prop="feedbackKind">
                    <el-select v-model="feedbackForm.feedbackKind" filterable placeholder="请选择反馈类型" size="small">
                        <el-option
                            v-for="item in typeOptions"
                            :key="item.key"
                            :label="item.value"
                            :value="item.key">
                        </el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="反馈内容" prop="content">
                    <el-input v-model="feedbackForm.content" size="small" placeholder="请输入反馈内容" type="textarea" :rows="3"></el-input>
                </el-form-item>
            </el-form>
            <div slot="footer" class="dialog-footer">
                <el-button size="small" @click="closeDialogFeedback">取 消</el-button>
                <el-button size="small" @click="submitFeedback" type="primary">确 定</el-button>
            </div>
        </el-dialog>
        <el-dialog title="临床反馈"
                   :close-on-click-modal="false"
                   :visible.sync="isShowMRFeedback"
                   @close="closeDialogMRFeedback"
                   center
                   width="600px">
            <el-form :model="MRFeedbackForm" :rules="rules" ref="feedbackMRForm" class="feedback-ruleForm">
                <el-form-item prop="content">
                    <el-input v-model="MRFeedbackForm.content" size="small" placeholder="请输入反馈内容" type="textarea" :rows="3"></el-input>
                </el-form-item>
                <el-upload
                    class="upload-img"
                    :class="imgList.length < 3 ? '' : 'none'"
                    ref="upload"
                    action=""
                    list-type="picture-card"
                    :file-list="imgList"
                    :limit="3"
                    :auto-upload="false"
                    :on-preview="handlePictureCardPreview"
                    :before-upload="beforeUpload"
                    :on-change="handleChange"
                    :on-remove="handleRemove">
                    <i class="el-icon-plus"></i>
                </el-upload>
                <el-dialog :visible.sync="dialogImgVisible" :modal="false">
                    <img width="100%" :src="dialogImageUrl" alt="">
                </el-dialog>
            </el-form>
            <div slot="footer" class="dialog-footer">
                <el-button size="small" @click="closeDialogMRFeedback">取 消</el-button>
                <el-button size="small" @click="submitMRFeedback" type="primary">确 定</el-button>
            </div>
        </el-dialog>
        <el-dialog
            title="质控评分"
            :visible.sync="isShowScore"
            :close-on-click-modal="false"
            @close="closeDialogScore"
            width="80%"
            center
            custom-class="score-dialog">
            <el-radio-group v-model="scoreType" @change="changeScoreType">
                <el-radio label="1">患者基本信息</el-radio>
                <el-radio label="2">住院过程信息</el-radio>
                <el-radio label="3">诊疗信息</el-radio>
                <el-radio label="4">费用信息</el-radio>
            </el-radio-group>
            <el-tabs v-model="activeNameTable">
                <el-tab-pane name="index" label="首页">
                    <el-table :data="scoreData" ref="detailstable" class="score-table" border style="width: 100%;max-height:550px;height: 510px;" height="510">
                        <el-table-column label="项目" align="center" prop="messageType" min-width="70">
                            <template slot-scope="scope">
                                {{getScoreType(scope.row.messageType)}}
                            </template>
                        </el-table-column>
                        <el-table-column
                            label="类别"
                            align="center"
                            prop="messageClass"
                            min-width="40">
                            <template slot-scope="scope">
                                {{getScoreClass(scope.row.messageClass)}}
                            </template>
                        </el-table-column>
                        <el-table-column
                            label="评分项"
                            prop="name"
                            min-width="170">
                            <template slot-scope="scope">
                                <span :class="scope.row.scoreType ? 'rating-items yellow' : 'rating-items blue'"></span>
                                {{scope.row.name}}
                            </template>
                        </el-table-column>
                        <el-table-column
                            label="填写值"
                            align="center"
                            prop="content"
                            min-width="100">
                        </el-table-column>
                        <el-table-column
                            label="分值"
                            align="center"
                            prop="scoreValue"
                            min-width="40">
                        </el-table-column>
                        <el-table-column
                            label="缺陷"
                            align="center"
                            prop="缺陷"
                            min-width="40">
                            <template slot-scope="scope">
                                <el-checkbox v-model="scope.row.isDeduction" :disabled="scope.row.isAuto" @change="changeScore(scope.row)">
                                </el-checkbox>
                            </template>
                        </el-table-column>
                        <el-table-column
                            label="扣分"
                            align="center"
                            prop="deduction"
                            min-width="35">
                            <template slot-scope="scope">
                                <span v-if="scope.row.deduction > 0" style="color:red">
                                    {{-scope.row.deduction}}
                                </span>
                                <span v-else>{{scope.row.deduction}}</span>
                            </template>
                        </el-table-column>
                        <el-table-column label="原因" prop="reason" min-width="200">
                            <template slot-scope="scope">
                                <el-select v-if="scope.row.isDeduction && !scope.row.isAuto" size="small"
                                           v-model="scope.row.reason" placeholder="请选择扣分原因" @change="changeScore(scope.row, 'select')">
                                    <el-option :label="scope.row.name+'填写不规范'" :value="scope.row.name+'填写不规范'"
                                               :key="0"></el-option>
                                    <el-option :label="scope.row.name+'填写遗漏'" :value="scope.row.name+'填写遗漏'"
                                               :key="1"></el-option>
                                    <el-option :label="scope.row.name+'填写错误'" :value="scope.row.name+'填写错误'"
                                               :key="2"></el-option>
                                </el-select>
                                <span v-else-if="scope.row.deduction > 0 && scope.row.isAuto">{{scope.row.reason}}</span>
                            </template>
                        </el-table-column>
                    </el-table>
                </el-tab-pane>
                <el-tab-pane name="appendix" label="附页" disabled></el-tab-pane>
            </el-tabs>
            <div slot="footer" class="dialog-footer">
                <el-row class="footer-score-box">
                    <el-col :span="8" class="national">
                        <span>{{nationalScore}}</span><span>分</span>
                        <p>国标得分</p>
                    </el-col>
                    <el-col :span="8" class="hospital">
                        <span>{{-hospitalScore}}</span><span>分</span>
                        <p>院标扣分</p>
                    </el-col>
                    <el-col :span="8" class="deduction">
                        <span>{{-hospitalDeduction}}</span><span>分</span>
                        <p>扣分</p>
                    </el-col>
                </el-row>
                <div class="btn-box">
                    <el-button size="small" @click="closeDialogScore">取 消</el-button>
                    <el-button size="small" @click="submitScore" type="primary">确 定</el-button>
                </div>
            </div>
        </el-dialog>
        <div class="searchICD" v-drag v-show="showICD">
            <div class="head can-drag">
                <img src="@/assets/image/kwt.png" class="can-drag" draggable="false"/>
                <p class="can-drag">ICD编码查询</p>
                <div @click="closeICDPop"><i class="el-icon-close down-btn"></i></div>
            </div>
            <div class="icd-content">
                <div class="search-pag" v-show="!showICDSearchRes">
                    <el-radio-group v-model="searchICD.typeYB" class="typeYB-choose">
                        <el-radio-button label="国临版2.0"></el-radio-button>
                        <el-radio-button label="医保版1.0"></el-radio-button>
                    </el-radio-group>
                    <el-radio-group class="radio-icd-box" v-model="searchICD.type">
                        <el-radio label="ICD-10">ICD-10</el-radio>
                        <el-radio label="ICD-9-CM-3">ICD-9-CM-3</el-radio>
                    </el-radio-group>
                    <el-input size="small" placeholder="请输入疾病名称/编码" v-model="searchICD.word" clearable @keyup.enter.native="submitSearchICD(1)" class="input-with-button">
                        <el-button size="small" slot="append" icon="el-icon-search" @click="submitSearchICD(1)">搜索</el-button>
                    </el-input>
                    <div class="logo-box">
                        <img src="@/assets/image/logo.png"/>
                        <a href="http://www.kwtsoft.com/" target="_blank">康卫通信息科技成都有限公司</a>
                    </div>
                </div>
                <div class="results-page" v-show="showICDSearchRes">
                    <div class="res-head">
                        <el-row class="title">
                            <el-col :span="2">
                                <div @click="closeICDRes">
                                    <i class="el-icon-arrow-left toback"></i>
                                </div>
                            </el-col>
                            <el-col :span="20">
                                版本: {{searchICD.typeYB}} {{searchICD.type}}
                            </el-col>
                        </el-row>
                        <el-input size="small" placeholder="请输入疾病名称/编码" v-model="searchICD.word" clearable @keyup.enter.native="submitSearchICD(1)" class="input-with-button">
                            <el-button size="small" slot="append" icon="el-icon-search" @click="submitSearchICD(1)">搜索</el-button>
                        </el-input>
                        <el-row class="res-select" v-show="searchICD.type !== 'ICD-10'">
                            <el-col :span="12">
                                <span>类别</span>
                                <el-select v-model="searchICD.category" @change="submitSearchICD(1)" class="res-category" size="small">
                                    <el-option key="1" label="全部" value="all"></el-option>
                                    <el-option key="2" label="手术" value="手术"></el-option>
                                    <el-option key="3" label="治疗性操作" value="治疗性操作"></el-option>
                                    <el-option key="4" label="诊断性操作" value="诊断性操作"></el-option>
                                    <el-option key="5" label="介入治疗" value="介入治疗"></el-option>
                                </el-select>
                            </el-col>
                            <el-col :span="12">
                                <span>录入选项</span>
                                <el-select v-model="searchICD.selectivity" @change="submitSearchICD(1)" class="res-selectivity" size="small">
                                    <el-option key="6" label="全部" value="all"></el-option>
                                    <el-option key="7" label="必选" value="必选"></el-option>
                                    <el-option key="8" label="选择性" value="选择性"></el-option>
                                    <el-option key="9" label="中医必选" value="中医必选"></el-option>
                                </el-select>
                            </el-col>
                        </el-row>
                    </div>
                    <div class="content-res-icd" :class="searchICD.type !== 'ICD-10' ? 'short' : ''" v-show="ICDTotal > 0">
                        <el-row type="flex" justify="space-between" v-for="(item, index) in ICDRes" class="content-row" :key="index">
                            <el-col :span="15" class="name">
                                {{item.diseaseName || item.name}}
                            </el-col>
                            <el-col :span="8" class="code">
                                {{item.fullCode || item.code}}
                            </el-col>
                            <el-col class="type" :span="24" v-show="searchICD.type !== 'ICD-10'">
                                <span>类别：{{item.type}}</span><span>录入选项：{{item.selectivity}}</span>
                            </el-col>
                        </el-row>
                    </div>
                    <p v-show="ICDTotal <= 0">抱歉！没有找到符合限定条件的记录。</p>
                    <pagination class="content-pag" v-show="ICDTotal > 0" :isSmall="true" :layout="'total, prev, pager, next'" :total="ICDTotal" :page.sync="currentPageICD" :limit.sync="ICDPageSize"
                                @pagination="submitSearchICD"/>
                </div>
            </div>
            <div class="top-line"></div>
            <div class="right-line"></div>
            <div class="bottom-line"></div>
            <div class="left-line"></div>
        </div>
    </div>
</template>

<script>
    import {
        ignoreData,
        cancelIgnoreData,
        saveFeedback,
        getScoreList,
        getScoreNum,
        submitScoreNum,
        searchICD10,
        searchICD10YB,
        searchICD9,
        searchICD9YB,
        submitFeedbackMR,
        reDRGSingle
    } from '@/api/medical-records/info-tool'
    import nameCoding from '@/assets/json/nameCoding.json'
    import Pagination from '@/components/Pagination'
    import {getMoneyNum} from '@/utils/filters'

    export default {
        name: 'infoTool',
        props: ['infoData'],
        model: {
            prop: 'infoData',
            event: 'changeInfoData'
        },
        data () {
            return {
                // 显示小助手
                showLittleHelper: true,
                // 小助手当前标签
                activeHelper: 'coding',
                // 显示意见反馈弹框
                isShowFeedback: false,
                // 显示临床反馈弹框
                isShowMRFeedback: false,
                // 类型选项
                typeOptions: [
                    {'key': 1, 'value': '编码问题'},
                    {'key': 2, 'value': '非编码问题'},
                    {'key': 3, 'value': '评分问题'},
                    {'key': 4, 'value': '统计问题'},
                    {'key': 5, 'value': '其他问题'}
                ],
                // 意见反馈表单
                feedbackForm: {
                    feedbackKind: '',
                    content: ''
                },
                // 临床反馈表单
                MRFeedbackForm: {
                    content: ''
                },
                // buffer列表
                bufferArr: [],
                // 图片列表
                imgList: [],
                // 预览图片路径
                dialogImageUrl: '',
                // 显示预览图片
                dialogImgVisible: false,
                // 评分弹框显示标签页
                activeNameTable: 'index',
                // 显示评分弹框
                isShowScore: false,
                // 评分类型
                scoreType: '1',
                // 评分列表数据
                scoreData: [],
                // 所有的扣分，项包括自动扣分项
                detailIdItem: [],
                // 国标得分
                nationalScore: 0,
                // 院标得分
                hospitalScore: 0,
                // 医院扣分
                hospitalDeduction: 0,
                // 评分获取的所有数据
                allScoreData: [],
                // 显示ICD查询
                showICD: false,
                // ICD查询内容
                searchICD: {
                    typeYB: '国临版2.0',
                    type: 'ICD-10',
                    word: '',
                    category: '',
                    selectivity: ''
                },
                // 显示ICD查询结果/查询页面
                showICDSearchRes: false,
                // ICD查询数据
                ICDRes: [],
                // ICD数据总数
                ICDTotal: 0,
                // ICD单页数量
                ICDPageSize: 50,
                // ICD当前页
                currentPageICD: 1,
                // 默认展开DRG
                activeCollapse: '1',
                userType: '',
                // 显示drg信息
                showDRGInfo: false,
                // 计时器
                timer: null,
                rules: {
                    feedbackKind: [
                        {required: true, message: '请选择反馈类型', trigger: 'change'}
                    ],
                    content: [
                        {required: true, message: '请输入反馈内容', trigger: ['blur', 'change']}
                    ]
                }
            }
        },
        computed: {
            isEdit () {
                return this.$store.state.user.isEdit
            },
            isLast () {
                let query = JSON.parse(JSON.stringify(this.$store.state.search.searchForm[this.$route.name]))
                return query.isLast
            }
        },
        directives: {
            drag (el) {
                el.onmousedown = function (e) {
                    if (e.target.className.includes('can-drag')) {
                        let disx = e.pageX - el.offsetLeft
                        let disy = e.pageY - el.offsetTop
                        document.onmousemove = function (e) {
                            el.style.left = e.pageX - disx + 'px'
                            el.style.top = e.pageY - disy + 'px'
                        }
                        document.onmouseup = function () {
                            document.onmousemove = document.onmouseup = null
                        }
                    }
                    let targetDivWidth = el.offsetWidth
                    let targetDivHeight = el.offsetHeight
                    let targetDivLeft = el.offsetLeft
                    let targetDivTop = el.offsetTop
                    if (e.target.className === 'top-line') {
                        let startY = e.clientY
                        document.onmousemove = function (e) {
                            let distY = Math.abs(e.clientY - startY)
                            if (e.clientY < startY) {
                                el.style.height = targetDivHeight + distY + 'px'
                                el.style.top = targetDivTop - distY + 'px'
                            } else {
                                el.style.height = targetDivHeight - distY + 'px'
                                el.style.top = targetDivTop + distY + 'px'
                            }
                            if (el.className === 'little-helper') {
                                if (document.getElementsByClassName('scroll-box').length) {
                                    let DRGHeight = document.getElementsByClassName('drg-content')[0].offsetHeight
                                    document.getElementsByClassName('scroll-box')[0].style.maxHeight = parseInt(el.style.height) - 174 - DRGHeight - 40 + 'px'
                                    document.getElementsByClassName('scroll-box')[1].style.maxHeight = parseInt(el.style.height) - 174 - DRGHeight - 40 + 'px'
                                    document.getElementsByClassName('scroll-box')[2].style.maxHeight = parseInt(el.style.height) - 174 - DRGHeight - 40 + 'px'
                                }
                            } else if (el.className === 'searchICD') {
                                if (document.getElementsByClassName('res-select')[0].offsetHeight) {
                                    document.getElementsByClassName('content-res-icd')[0].style.maxHeight = parseInt(el.style.height) - 162 - 42 + 'px'
                                } else {
                                    document.getElementsByClassName('content-res-icd')[0].style.maxHeight = parseInt(el.style.height) - 162 + 'px'
                                }
                            }
                        }
                        document.onmouseup = function () {
                            document.onmousemove = document.onmouseup = null
                        }
                    }
                    if (e.target.className === 'bottom-line') {
                        let startY = e.clientY
                        document.onmousemove = function (e) {
                            let distY = Math.abs(e.clientY - startY)
                            if (e.clientY < startY) {
                                el.style.height = targetDivHeight - distY + 'px'
                            } else {
                                el.style.height = targetDivHeight + distY + 'px'
                            }
                            if (el.className === 'little-helper') {
                                if (document.getElementsByClassName('scroll-box').length) {
                                    let DRGHeight = document.getElementsByClassName('drg-content')[0].offsetHeight
                                    document.getElementsByClassName('scroll-box')[0].style.maxHeight = parseInt(el.style.height) - 174 - DRGHeight - 40 + 'px'
                                    document.getElementsByClassName('scroll-box')[1].style.maxHeight = parseInt(el.style.height) - 174 - DRGHeight - 40 + 'px'
                                    document.getElementsByClassName('scroll-box')[2].style.maxHeight = parseInt(el.style.height) - 174 - DRGHeight - 40 + 'px'
                                }
                            } else if (el.className === 'searchICD') {
                                if (document.getElementsByClassName('res-select')[0].offsetHeight) {
                                    document.getElementsByClassName('content-res-icd')[0].style.maxHeight = parseInt(el.style.height) - 162 - 42 + 'px'
                                } else {
                                    document.getElementsByClassName('content-res-icd')[0].style.maxHeight = parseInt(el.style.height) - 162 + 'px'
                                }
                            }
                        }
                        document.onmouseup = function () {
                            document.onmousemove = document.onmouseup = null
                        }
                    }
                    if (e.target.className === 'left-line') {
                        let startX = e.clientX
                        document.onmousemove = function (e) {
                            let distX = Math.abs(e.clientX - startX)
                            if (e.clientX < startX) {
                                el.style.width = targetDivWidth + distX + 'px'
                                el.style.left = targetDivLeft - distX + 'px'
                            } else {
                                el.style.width = targetDivWidth - distX + 'px'
                                el.style.left = targetDivLeft + distX + 'px'
                            }
                        }
                        document.onmouseup = function () {
                            document.onmousemove = document.onmouseup = null
                        }
                    }
                    if (e.target.className === 'right-line') {
                        let startX = e.clientX
                        document.onmousemove = function (e) {
                            let distX = Math.abs(e.clientX - startX)
                            if (e.clientX < startX) {
                                el.style.width = targetDivWidth - distX + 'px'
                            } else {
                                el.style.width = targetDivWidth + distX + 'px'
                            }
                        }
                        document.onmouseup = function () {
                            document.onmousemove = document.onmouseup = null
                        }
                    }
                }
            }
        },
        created () {
            this.userType = localStorage.getItem('userType').toString()
            if (localStorage.getItem('cloudMode') === 'false') {
                this.showDRGInfo = JSON.parse(localStorage.getItem('rolesCode')).includes(200000000000) && JSON.parse(localStorage.getItem('hasSystems')).includes('MRDRG')
            }
            this.showDRGInfo = JSON.parse(localStorage.getItem('rolesCode')).includes(200000000000)
        },
        mounted () {
            if (this.showDRGInfo) {
                this.timer = setInterval(this.collapseDrg, 10)
            }
        },
        methods: {
            /**
             * 显示隐藏小助手
             */
            showLittleHelperPop () {
                this.showLittleHelper = !this.showLittleHelper
            },
            /**
             * 获取小助手数据
             */
            getHelperData () {
                this.nationalScore = this.infoData.nationScore
                this.hospitalScore = this.infoData.hospitalScore
                this.hospitalDeduction = this.infoData.deduction
            },
            /**
             * 获取标签页名称
             * @param name 标签名
             */
            getTabsTitle (name) {
                switch (name) {
                case 'score':
                    return this.infoData.nationScore ? `扣分(${this.infoData.nationScore - 100})分` : '扣分(0分)'
                case 'coding':
                    return this.infoData.coding ? `编码缺陷(${this.infoData.coding})处` : '编码缺陷(0)处'
                case 'notCoding':
                    return this.infoData.noneCoding ? `非编码缺陷(${this.infoData.noneCoding})处` : '非编码缺陷(0)处'
                }
            },
            /**
             * 忽略
             * @param id 数据id
             * @param name 数据类型
             */
            ignore (id, name) {
                let params = {id}
                ignoreData(params).then(res => {
                    if (res.code.toString() === '200') {
                        let infoData = this.infoData
                        if (name === 'coding') {
                            for (let i = 0; i < infoData.codingWaring.length; i++) {
                                if (infoData.codingWaring[i].id === id) {
                                    infoData.codingWaring[i].isIgnored = true
                                    break
                                }
                            }
                        } else if (name === 'notCoding') {
                            for (let i = 0; i < infoData.noneCodingWaring.length; i++) {
                                if (infoData.noneCodingWaring[i].id === id) {
                                    infoData.noneCodingWaring[i].isIgnored = true
                                    break
                                }
                            }
                        }
                        this.$emit('changeInfoData', infoData)
                        this.$message.success('忽略成功!')
                    } else {
                        this.$message.error(res.message)
                    }
                })
            },
            /**
             * 取消忽略
             * @param id 数据id
             * @param name 数据类型
             */
            cancelIgnore (id, name) {
                let params = {id}
                cancelIgnoreData(params).then(res => {
                    if (res.code.toString() === '200') {
                        let infoData = this.infoData
                        if (name === 'coding') {
                            for (let i = 0; i < infoData.codingWaring.length; i++) {
                                if (infoData.codingWaring[i].id === id) {
                                    infoData.codingWaring[i].isIgnored = false
                                    break
                                }
                            }
                        } else if (name === 'notCoding') {
                            for (let i = 0; i < infoData.noneCodingWaring.length; i++) {
                                if (infoData.noneCodingWaring[i].id === id) {
                                    infoData.noneCodingWaring[i].isIgnored = false
                                    break
                                }
                            }
                        }
                        this.$emit('changeInfoData', infoData)
                        this.$message.success('成功取消忽略!')
                    } else {
                        this.$message.error(res.message)
                    }
                })
            },
            /**
             * 打开意见反馈弹框
             */
            showDialogFeedback () {
                this.isShowFeedback = true
            },
            /**
             * 关闭意见反馈弹框
             */
            closeDialogFeedback () {
                this.$refs['feedbackForm'].resetFields()
                this.isShowFeedback = false
            },
            /**
             * 提交意见反馈表单
             */
            submitFeedback () {
                this.$refs['feedbackForm'].validate((valid) => {
                    if (valid) {
                        let params = this.feedbackForm
                        saveFeedback(params).then(res => {
                            if (res.code.toString() === '200') {
                                this.$message.success('提交意见反馈成功!')
                                this.closeDialogFeedback()
                            } else {
                                this.$message.error(res.message)
                            }
                        })
                    } else {
                        return false
                    }
                })
            },
            /**
             * 打开临床反馈弹框
             */
            showDialogMRFeedback () {
                this.isShowMRFeedback = true
                this.MRFeedbackForm.content = ''
            },
            /**
             * 关闭临床反馈弹框
             */
            closeDialogMRFeedback () {
                this.imgList = []
                this.bufferArr = []
                this.$refs.upload.clearFiles()
                this.$refs['feedbackMRForm'].resetFields()
                this.isShowMRFeedback = false
            },
            /**
             * 提交临床反馈
             */
            submitMRFeedback () {
                this.$refs['feedbackMRForm'].validate((valid) => {
                    if (valid) {
                        let params = {
                            receiverName: this.infoData.ZYYS,
                            bah: this.infoData.BAH,
                            zycs: this.infoData.ZYCS,
                            content: this.MRFeedbackForm.content,
                            images: []
                        }
                        this.imgList.forEach((item, index) => {
                            params.images.push({
                                sort: index + 1,
                                name: item.name,
                                buffers: this.bufferArr[index]
                            })
                        })
                        submitFeedbackMR(params).then(res => {
                            if (res.code.toString() === '200') {
                                this.$message.success('提交临床反馈成功!')
                                this.closeDialogMRFeedback()
                            } else {
                                this.$message.error(res.message)
                            }
                        })
                    } else {
                        return false
                    }
                })
            },
            /**
             * 文件上传成功
             */
            handleChange (file) {
                if (file.status === 'ready') {
                    this.imgList.push(file)
                    this.imageProcessing(file.raw).then(res => {
                        this.bufferArr.push(res)
                    })
                }
            },
            /**
             * 预览图片
             * @param file 文件对象
             */
            handlePictureCardPreview (file) {
                this.dialogImageUrl = file.url
                this.dialogImgVisible = true
            },
            /**
             * 移除图片
             */
            handleRemove (file, fileList) {
                this.imgList = fileList
            },
            /**
             * 图片转换
             * @param file 文件对象
             */
            imageProcessing (file) {
                let _this = this
                return new Promise(function (resolve) {
                    let reader = new FileReader()
                    reader.readAsArrayBuffer(file)
                    reader.onload = function () {
                        resolve(_this.buf2hex(reader.result))
                    }
                })
            },
            /**
             * buffer数组转byte
             * @param buffer buffer数组
             */
            buf2hex (buffer) {
                return Array.prototype.map.call(new Uint8Array(buffer), x => ('00' + x.toString(16)).slice(-2)).join('')
            },
            /**
             * 图片上传前
             */
            beforeUpload (file) {
                let isLt10M = file.size / 1024 / 1024 < 10
                if (!isLt10M) {
                    this.$message.error('图片大小不能超过 10MB!')
                }
                return isLt10M
            },
            /**
             * 打开得分列表获取数据
             */
            getScoreTableData () {
                let query = JSON.parse(JSON.stringify(this.$store.state.search.searchForm[this.$route.name]))
                let params = {
                    medicalRecordSign: this.infoData.medicalRecordSign,
                    hospitalTime: Number(this.infoData.ZYCS),
                    isLast: query.isLast,
                    orgId: query.orgId
                }
                this.isShowScore = true
                this.hospitalScore = 0
                getScoreList(params).then(res => {
                    if (res.code.toString() === '200') {
                        this.scoreType = '1'
                        this.allScoreData = res.data
                        this.detailIdItem = []
                        this.allScoreData.forEach(item => {
                            if (item.deduction > 0 && item.isDeduction) {
                                this.detailIdItem.push({
                                    field: item.field,
                                    reason: item.reason,
                                    scoreType: item.scoreType
                                })
                            }
                        })
                        this.getScore()
                        this.changeScoreType()
                    } else {
                        this.$message.error(res.message)
                    }
                })
            },
            /**
             * 关闭评分弹框
             */
            closeDialogScore () {
                this.isShowScore = false
            },
            /**
             * 修改评分类型
             */
            changeScoreType () {
                this.scoreData = []
                switch (this.scoreType) {
                case '1':
                    this.allScoreData.forEach(item => {
                        if (item.messageType === 1) { this.scoreData.push(item) }
                    })
                    break
                case '2':
                    this.allScoreData.forEach(item => {
                        if (item.messageType === 2) { this.scoreData.push(item) }
                    })
                    break
                case '3':
                    this.allScoreData.forEach(item => {
                        if (item.messageType === 3) { this.scoreData.push(item) }
                    })
                    break
                case '4':
                    this.allScoreData.forEach(item => {
                        if (item.messageType === 4) { this.scoreData.push(item) }
                    })
                    break
                }
            },
            /**
             * 修改评分
             * @param row 行数据
             * @param type 修改方式select是0分
             */
            changeScore (row, type) {
                let index = 0
                if (!row.isDeduction && this.detailIdItem.length > 0) {
                    for (let i = 0; i < this.detailIdItem.length; i++) {
                        if (this.detailIdItem[i].field === row.field && this.detailIdItem[i].scoreType === row.scoreType) {
                            index = i
                            break
                        }
                    }
                    if (index >= 0) {
                        this.detailIdItem.splice(index, 1)
                        this.getScore()
                    }
                    row.deduction = 0
                } else {
                    if (this.detailIdItem.length >= 0) {
                        for (let i = 0; i < this.detailIdItem.length; i++) {
                            if (this.detailIdItem[i].field === row.field && this.detailIdItem[i].scoreType === row.scoreType) {
                                index = i
                                break
                            }
                        }
                        if (this.detailIdItem.length > 0 &&
                            this.detailIdItem[index].field === row.field && this.detailIdItem[index].scoreType === row.scoreType) {
                            this.detailIdItem[index].reason = row.reason
                            // }
                            return
                        } else {
                            this.detailIdItem.push({
                                field: row.field,
                                reason: row.reason,
                                scoreType: row.scoreType
                            })
                        }
                        this.getScore()
                        row.deduction = type ? 0 : row.scoreValue
                    }
                }
            },
            /**
             * 计算分数
             */
            getScore () {
                let query = JSON.parse(JSON.stringify(this.$store.state.search.searchForm[this.$route.name]))
                let params = {
                    detailId: this.infoData.medicalRecordID,
                    items: this.detailIdItem,
                    orgId: query.orgId
                }
                getScoreNum(params).then(res => {
                    if (res.code.toString() === '200') {
                        this.hospitalScore = res.data.yyTotalScore
                        this.nationalScore = res.data.gbTotalScore
                        this.hospitalDeduction = res.data.deduction
                    } else {
                        this.$message.error(res.message)
                    }
                })
            },
            /**
             * 提交修改评分
             */
            submitScore () {
                let flag = true
                for (let i = 0; i < this.detailIdItem.length; i++) {
                    if (!this.detailIdItem[i].reason) {
                        this.$message.error('扣分原因不能为空!')
                        flag = false
                        break
                    }
                }
                if (flag) {
                    let query = JSON.parse(JSON.stringify(this.$store.state.search.searchForm[this.$route.name]))
                    let params = {
                        detailId: this.infoData.medicalRecordID,
                        items: this.detailIdItem,
                        orgId: query.orgId,
                        dischargeDate: this.infoData.dischargeDate || this.parseTime(new Date().getTime())
                    }
                    submitScoreNum(params).then(res => {
                        if (res.code.toString() === '200') {
                            this.$message.success('提交评分成功!')
                            this.closeDialogScore()
                            this.$emit('getData', this.infoData.medicalRecordID)
                        } else {
                            this.$message.error(res.message)
                        }
                    }).catch(() => {
                        this.$message.error('提交失败!')
                    })
                }
            },
            /**
             * 点击错误信息调用
             */
            searchTipICD (data, type) {
                this.openICDPop()
                if (type === 'icd9') {
                    this.searchICD.type = 'ICD-9-CM-3'
                }
                this.searchICD.word = data
                this.submitSearchICD(1)
            },
            /**
             * 打开ICD查询
             */
            openICDPop () {
                this.searchICD.typeYB = '国临版2.0'
                this.searchICD.type = 'ICD-10'
                this.searchICD.word = ''
                this.searchICD.category = 'all'
                this.searchICD.selectivity = 'all'
                this.ICDRes = []
                this.ICDTotal = 0
                this.showICDSearchRes = false
                this.showICD = true
            },
            /**
             * 关闭ICD查询
             */
            closeICDPop () {
                this.ICDRes = []
                this.ICDTotal = 0
                this.showICDSearchRes = false
                this.showICD = false
            },
            /**
             * 查询ICD
             * @param page 指定页数/重新输入查询
             */
            submitSearchICD (page) {
                let params = {
                    keyWord: this.searchICD.word,
                    pageCount: this.ICDPageSize,
                    pageIndex: typeof page === 'object' ? page.page : page
                }
                if (this.searchICD.typeYB === '国临版2.0') {
                    if (this.searchICD.type === 'ICD-10') {
                        searchICD10(params).then(res => {
                            this.ICDRes = res.data.rows
                            this.ICDTotal = Number(res.data.total)
                            this.showICDSearchRes = true
                            let allHeight = document.getElementsByClassName('searchICD')[0].offsetHeight
                            document.getElementsByClassName('content-res-icd')[0].style.maxHeight = parseInt(allHeight) - 162 + 'px'
                        })
                    } else {
                        params.type = this.searchICD.category === 'all' ? '' : this.searchICD.category
                        params.selectivity = this.searchICD.selectivity === 'all' ? '' : this.searchICD.selectivity
                        searchICD9(params).then(res => {
                            this.ICDRes = res.data.rows
                            this.ICDTotal = Number(res.data.total)
                            this.showICDSearchRes = true
                            let allHeight = document.getElementsByClassName('searchICD')[0].offsetHeight
                            document.getElementsByClassName('content-res-icd')[0].style.maxHeight = parseInt(allHeight) - 162 - 42 + 'px'
                        })
                    }
                } else {
                    if (this.searchICD.type === 'ICD-10') {
                        params.pageSize = params.pageCount
                        searchICD10YB(params).then(res => {
                            this.ICDRes = res.data.rows
                            this.ICDTotal = Number(res.data.total)
                            this.showICDSearchRes = true
                            let allHeight = document.getElementsByClassName('searchICD')[0].offsetHeight
                            document.getElementsByClassName('content-res-icd')[0].style.maxHeight = parseInt(allHeight) - 162 + 'px'
                        })
                    } else {
                        params.type = this.searchICD.category === 'all' ? '' : this.searchICD.category
                        params.selectivity = this.searchICD.selectivity === 'all' ? '' : this.searchICD.selectivity
                        params.pageSize = params.pageCount
                        searchICD9YB(params).then(res => {
                            this.ICDRes = res.data.rows
                            this.ICDTotal = Number(res.data.total)
                            this.showICDSearchRes = true
                            let allHeight = document.getElementsByClassName('searchICD')[0].offsetHeight
                            document.getElementsByClassName('content-res-icd')[0].style.maxHeight = parseInt(allHeight) - 162 - 42 + 'px'
                        })
                    }
                }
            },
            /**
             * 关闭ICD结果页面返回第一个页面
             */
            closeICDRes () {
                this.searchICD.category = 'all'
                this.searchICD.selectivity = 'all'
                this.showICDSearchRes = false
            },
            /**
             * 获取信息类型
             * @param val 类型值
             */
            getScoreType (val) {
                switch (val.toString()) {
                case '1':
                    return '患者基本信息'
                case '2':
                    return '住院过程信息'
                case '3':
                    return '诊疗信息'
                case '4':
                    return '费用信息'
                }
            },
            /**
             * 获取信息类别
             * @param val 类别值
             */
            getScoreClass (val) {
                switch (val.toString()) {
                case '1':
                    return 'A类'
                case '2':
                    return 'B类'
                case '3':
                    return 'C类'
                case '4':
                    return 'D类'
                }
            },
            /**
             * 打开关闭drg信息
             */
            collapseDrg () {
                let DRGHeight = this.showDRGInfo ? document.getElementsByClassName('drg-content')[0].offsetHeight : 0
                let maxHeight = document.getElementsByClassName('little-helper')[0].offsetHeight - 174 - DRGHeight - 40 + 'px'
                document.getElementsByClassName('scroll-box')[0].style.maxHeight = maxHeight
                document.getElementsByClassName('scroll-box')[1].style.maxHeight = maxHeight
                document.getElementsByClassName('scroll-box')[2].style.maxHeight = maxHeight
            },
            /**
             * 重试DRG
             */
            refreshDRG () {
                let query = JSON.parse(JSON.stringify(this.$store.state.search.searchForm[this.$route.name]))
                let params = {
                    medicalRecordSign: this.infoData.medicalRecordSign,
                    hospitalTime: Number(this.infoData.ZYCS),
                    isLast: query.isLast,
                    orgId: query.orgId
                }
                reDRGSingle(params).then(res => {
                    if (res.code.toString() === '200') {
                        if (res.data) {
                            this.$emit('changeInfoData', {...this.infoData, DRGsData: res.data})
                            sessionStorage.setItem(`${this.$route.name}QCInfo`, JSON.stringify({...this.infoData, DRGsData: res.data}))
                        } else {
                            this.$emit('changeInfoData', {...this.infoData, DRGsData: res.data})
                        }
                    }
                })
            },
            /**
             * 获取需转码数据
             * @param code 类型值
             * @param val 数据参数
             */
            checkCodeText (code, val) {
                if (code === 'bjks' && val) {
                    let valArr = val.split(',')
                    let res = ''
                    valArr.forEach(item => {
                        res += nameCoding[code] ? nameCoding[code][item] || item : item
                        res += ','
                    })
                    res = res.substring(0, res.length - 1)
                    return res
                } else {
                    return nameCoding[code] ? nameCoding[code][val] || val : val
                }
            }
        },
        filters: {
            getMoneyNum
        },
        components: {
            Pagination
        },
        beforeDestroy () {
            clearInterval(this.timer)
        }
    }
</script>

<style scoped lang="scss">
    .little-helper, .searchICD {
        position: fixed;
        z-index: 1999;
        right: 10px;
        bottom: 10px;
        background: #fff;
        color: #333;
        width: 350px;
        height: 520px;
        line-height: 22px;
        font-size: 14px;
        overflow: hidden;
        border: 1px solid #dcdcdc;
        border-radius: 4px;
        -webkit-border-radius: 5px;
        -moz-border-radius: 5px;
        box-shadow: 0 0 8px #b1b1b1;
        .head {
            height: 38px;
            display:flex;
            justify-content: flex-start;
            align-items: center;
            padding: 5px;
            background: #f2f2f2;
            position: relative;
            -webkit-user-select:none;
            -moz-user-select:none;
            -ms-user-select:none;
            user-select:none;
            img {
                display: block;
                width: 26px;
            }
            p {
                font-weight: 600;
                font-size: 16px;
                margin: 0 0 0 10px;
                span {
                    color: #409eff;
                }
            }
            div {
                width: 38px;
                height: 38px;
                position: absolute;
                right: 0;
                top: 0;
                cursor: pointer;
                .down-btn, .up-btn {
                    position: absolute;
                    top: 9px;
                    right: 9px;
                    color: #409eff;
                    font-size: 20px;
                }
            }
        }
        &.small {
            height: 38px;
        }
        .scroe {
            position: relative;
            margin-bottom: 10px;
            display: flex;
            justify-content: center;
            align-items: center;
            div {
                margin-right: 10px;
                &:nth-child(1) {
                    margin-right: 20px;
                }
                &:nth-child(2) {
                    span {
                        color: #F59A23;
                    }
                }
                p {
                    font-size: 14px;
                    text-align: center;
                    margin: 0;
                    line-height: 20px;
                    span {
                        font-size: 24px;
                        font-weight: 600;
                        color: #409eff;
                    }
                }
            }
            .edit {
                position: absolute;
                left: 240px;
                top: 1px;
                width: 40px;
                font-size: 16px;
            }
            .icd {
                position: absolute;
                left: 300px;
                top: 13px;
                font-size: 12px;
                line-height: 12px;
                padding: 2px;
                border-radius: 4px;
                color: #409eff;
                border: 1px solid #409eff;
                cursor: pointer;
            }
        }
        .helper-content {
            padding: 0 5px;
            .scroll-box {
                height: auto;
                max-height: 262px;
                overflow-y: auto;
                &::-webkit-scrollbar {
                    width: 8px;
                    height: 1px;
                }
                &::-webkit-scrollbar-thumb {
                    border-radius: 10px;
                    -webkit-box-shadow: inset 0 0 5px rgb(204, 204, 204);
                    background-color: #7f7d7d;
                }
                &::-webkit-scrollbar-track {
                    border-radius: 8px;
                    -webkit-box-shadow: inset 0 0 5px rgb(204, 204, 204);
                    background-color: #f7f0f0;
                }
                .scroll-row {
                    padding: 0 4px;
                    background: #f2f2f2;
                    font-weight: 600;
                    margin-bottom: 6px;
                    line-height: 18px;
                    .score-row {
                        width: 100%;
                        display: block;
                        color: #e21f06;
                        text-align: right;
                    }
                }
                .scroll-row-title {
                    padding: 0 4px;
                    font-weight: 600;
                    margin-bottom: 6px;
                    line-height: 18px;
                    .block {
                        display: inline-block;
                        width: 4px;
                        height: 12px;
                        background: #ec3434;
                        border-radius: 2px;
                        margin-right: 4px;
                        &.doubt {
                            background: #ec7534;
                        }
                    }
                    .span {
                        color: #ec3434;
                        &.doubt {
                            color: #ec7534;
                        }
                    }
                }
                .ignored {
                    padding-top: 5px;
                    span {
                        color: #e6a23c;
                    }
                }
            }
        }
        .feedback {
            width: 100%;
            position: absolute;
            bottom: 0;
            left: 0;
            display: flex;
            justify-content: center;
            align-items: center;
            background: #fff;
            &.between {
                padding: 0 5px;
                justify-content: space-between;
            }
        }
        .top-line {
            position: absolute;
            top: -2px;
            left: 0;
            height: 6px;
            width: 100%;
            background: transparent;
            cursor: n-resize;
        }
        .right-line {
            position: absolute;
            top: 0;
            right: -2px;
            height: 100%;
            width: 6px;
            background: transparent;
            cursor: e-resize;
        }
        .bottom-line {
            position: absolute;
            bottom: -2px;
            left: 0;
            height: 6px;
            width: 100%;
            background: transparent;
            cursor: n-resize;
        }
        .left-line {
            position: absolute;
            top: 0;
            left: -2px;
            height: 100%;
            width: 6px;
            background: transparent;
            cursor: e-resize;
        }
    }
    .searchICD {
        right: 364px;
    }
    /deep/.el-tabs__item {
        padding: 0 6px;
    }
    .dialog-footer {
        text-align: center;
    }
    .searchICD {
        .icd-content {
            .search-pag {
                padding: 5px 5px 0 5px;
                .typeYB-choose {
                    display: flex;
                    justify-content: center;
                    margin: 30px 0;
                    /deep/.el-radio-button__inner {
                        padding: 10px 48px;
                    }
                }
                .radio-icd-box {
                    width: 100%;
                    text-align: center;
                    margin-bottom: 20px;
                }
                .logo-box {
                    margin-top: 170px;
                    text-align: center;
                    img {
                        display: block;
                        width: 100px;
                        margin: 0 auto;
                    }
                    a {
                        color: #409EFF;
                        &:hover {
                            color: #409EFF;
                        }
                    }
                }
            }
            .results-page {
                padding: 0 5px;
                .res-head {
                    .title {
                        margin: 0 0 10px 0;
                        line-height: 22px;
                        .toback {
                            font-size: 18px;
                            margin-top: 2px;
                            cursor: pointer;
                        }
                    }
                    .res-select {
                        margin-top: 10px;
                        .res-category {
                            width: 114px;
                        }
                        .res-selectivity {
                            width: 100px;
                        }
                    }
                }
                .content-res-icd {
                    margin-top: 5px;
                    height: auto;
                    max-height: 360px;
                    overflow-y: auto;
                    &.short {
                        max-height: 318px;
                    }
                    &::-webkit-scrollbar {
                        width: 10px;
                        height: 1px;
                    }
                    &::-webkit-scrollbar-thumb {
                        border-radius: 10px;
                        -webkit-box-shadow: inset 0 0 5px rgb(204, 204, 204);
                        background-color: #7f7d7d;
                    }
                    &::-webkit-scrollbar-track {
                        border-radius: 8px;
                        -webkit-box-shadow: inset 0 0 5px rgb(204, 204, 204);
                        background-color: #f7f0f0;
                    }
                    .content-row {
                        padding: 2px 0;
                        border-bottom: 1px solid #eee;
                        flex-wrap: wrap;
                        &:last-child {
                        }
                        .name, .code {
                            font-size: 14px;
                            font-weight: 600;
                        }
                        .code {
                            box-sizing: border-box;
                            padding-right: 8px;
                            word-break: break-all;
                        }
                        .type {
                            margin: 0;
                            span:first-child {
                                margin-right: 10px;
                            }
                        }
                    }
                }
                .content-pag {
                    margin-top: 10px;
                    padding: 0;
                    /deep/.pagination {
                        text-align: center;
                        .el-pagination__total {
                            font-size: 12px;
                        }
                    }
                }
            }
        }
    }
    .drg-content {
        margin: 10px;
        padding: 10px;
        background: #F5F6FA;
        border-radius: 4px;
        /deep/.el-collapse {
            border: 0;
            .el-collapse-item {
                .el-collapse-item__header {
                    background: #F5F6FA;
                    line-height: 18px;
                    height: auto;
                    border: 0;
                }
                .el-collapse-item__content {
                    background: #F5F6FA;
                    padding-bottom: 0;
                    p {
                        line-height: 18px;
                        margin: 0;
                    }
                }
                .el-collapse-item__wrap {
                    border: 0;
                }
            }
            .income {
                span {
                    .el-icon-top {
                        color: #ee3934;
                    }
                    .el-icon-bottom {
                        color: #1682e6;
                    }
                    &.span-blue {
                        color: #1682e6;
                    }
                    &.span-red {
                        color: #ee3934;
                    }
                }
            }
        }
        .refresh-btn {
            margin-left: 6px;
            font-size: 13px;
            color: #1682e6;
            height: 18px;
            cursor: pointer;
            white-space: nowrap;
            svg {
                width: 14px;
                height: 14px;
                margin-bottom: -2px;
            }
        }
    }
</style>
<style lang="scss">
    .score-dialog {
        width: 80%;
        margin-top: 8vh!important;
        .el-dialog__title {
            font-weight: 600;
        }
        .el-dialog__body {
            padding: 15px 20px 20px;
        }
        .el-radio-group {
            width: 100%;
            text-align: right;
        }
        .score-table {
            .rating-items {
                width: 6px;
                height: 12px;
                display: inline-block;
                vertical-align: middle;
                margin: 0;
                border-radius: 2px;
                &.blue {
                    background: #1297dc;
                }
                &.yellow {
                    background: #f29716;
                }
            }
        }
        .dialog-footer {
            display: flex;
            justify-content: space-between;
            align-items: center;
            .footer-score-box {
                width: 50%;
                p {
                    margin: 0;
                    font-weight: 500;
                }
                span:first-child {
                    font-size: 24px;
                }
                .national {
                    color: #66a0f2;
                }
                .hospital {
                    color: #ff8100;
                }
                .deduction {
                    color: #e21f06;
                }
            }
        }
    }
    .normal {
        font-weight: normal;
    }
    .upload-img {
        max-height: 159px;
        overflow: hidden;
        &.none {
            & > .el-upload.el-upload--picture-card {
                display: none;
            }
        }
    }
</style>
